<!DOCTYPE html>
<html>
#{include file="header.html"}#
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
  <div class="row">
    <div class="col-sm-12">
      <div class="ibox float-e-margins">
        <div class="ibox-content">
          <form class="form-horizontal" method="post" action="#">
            <div class="form-group">
              <label class="col-sm-2 control-label">通知标题</label>
              <div class="col-sm-8">
                <input name="title" class="form-control" type="text" placeholder="输入标题" required/>
                <span class="help-block m-b-none"></span> </div>
            </div>
			  	 <div class="form-group">
              <label class="col-sm-2 control-label">通知对象</label>
              <div class="col-sm-8">
                #{$role_opt}#
                <span class="help-block m-b-none">通知需要下发的团队员及成员，默认为当前用户及下级成员</span> </div>
            </div>
				  <div class="form-group text-left">
					<label class="col-sm-2 control-label">指定对象</label>
					<div class="col-sm-10">
					  <select data-placeholder="选择指定对象..." name="sys_user_id" class="chosen-select sys_user-chosen-select" style="width: 200px;" tabindex="2">
						<option value="">请选指定对象</option>           
								  #{foreach from=$sys_user key=k item=v}#	  
						<option value="#{$v.id}#" hassubinfo="true">#{$v.name}#</option>
								  #{/foreach}#
					  </select>
						<span class="help-block m-b-none">此功能针对单独一个用户通知</span>
					</div>
				  </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">通知内容</label>
              <div class="col-sm-8">
                <textarea name="content" class="form-control" cols="80" rows="2">#{$one.content}#</textarea>
                <span class="help-block m-b-none"></span> </div>
            </div>
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-8">
                <button class="btn  btn-w-m btn-info save-form" type="button">保存数据</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="#{$smarty.const.APP}#/View/template/js/content.js?v=1.0.0"></script> 	
<script>
$(document).ready(function () {
	$('.i-checks').iCheck({
		checkboxClass: 'icheckbox_square-green',
		radioClass: 'iradio_square-green',
	});
	//下拉选择+联动效果
	$('.chosen-select').chosen({search_contains: true});
	//数据保存
	$("body").on("click", ".save-form", function() {
		FormData=$("form").serialize();
		$.ajax({
			type: "POST",
			url: "#{$smarty.const.ACT}#/sysmanage/Notice/notice_add/",
			data:FormData,
			dataType:"json",
			success: function(data){
				if(data.statusCode=='200'){
					layer.msg('操作成功', {icon: 1}); 		
				}
			},    
			complete: function() {   
				setTimeout(function(){
					//关闭窗口
					var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
					parent.layer.close(index);
				 },800);
   		  },
		});		
	});
});
</script>
</body>
</html>
